{{!
  Copyright IBM Corp. 2016, 2025
  SPDX-License-Identifier: BUSL-1.1
}}
<Page::Header @title={{@model.name}}>
  <:breadcrumbs>
    <Page::Breadcrumbs @breadcrumbs={{@breadcrumbs}} />
  </:breadcrumbs>
  <:actions>
    <Hds::Dropdown as |D|>
      <D.ToggleButton @text="Manage" @color="secondary" data-test-dropdown="Manage" />
      {{#if @model.canEdit}}
        <D.Interactive @icon="settings" @route="libraries.library.edit" data-test-popup-menu="Edit library">Edit library</D.Interactive>
      {{/if}}
      {{#if @model.canDelete}}
        <D.Interactive
          @icon="trash"
          @color="critical"
          {{on "click" (fn (mut this.showConfirmModal) true)}}
          data-test-popup-menu="Delete library"
        >Delete library</D.Interactive>
      {{/if}}
    </Hds::Dropdown>
  </:actions>
  <:tabs>
    <nav class="tabs" aria-label="ldap tabs">
      <ul>
        <li><LinkTo @route="libraries.library.details.accounts" data-test-tab="accounts">Accounts</LinkTo></li>
        <li><LinkTo @route="libraries.library.details.configuration" data-test-tab="config">Configuration</LinkTo></li>
      </ul>
    </nav>
  </:tabs>
</Page::Header>

{{#if this.showConfirmModal}}
  <ConfirmModal
    @color="critical"
    @confirmMessage="You will not be able to recover it later."
    @confirmTitle="Are you sure?"
    @onClose={{fn (mut this.showConfirmModal) false}}
    @onConfirm={{this.delete}}
  />
{{/if}}